﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;

public class MyPipeline : RenderPipeline
{
    private bool _useDynamicBatch;
    private bool _useGPUInstance;
    private bool _useSRPBatch;
    private ShadowSettings _shadowSettings;
    private MyRender _myRender;
    public MyPipeline(bool dy, bool gI, bool sB, ShadowSettings _ss)
    {
        GraphicsSettings.useScriptableRenderPipelineBatching = sB;
        GraphicsSettings.lightsUseLinearIntensity = true;
        _useDynamicBatch = dy;
        _useGPUInstance = gI;
        _shadowSettings = _ss;
        _myRender = new MyRender(_useDynamicBatch, _useGPUInstance, _shadowSettings);

    }

    protected override void Render(ScriptableRenderContext context, Camera[] cameras)
    {
        for(int n = 0; n < cameras.Length; n++)
        {
            Camera c = cameras[n];
            _myRender.Rendering(context, c);
        }
    }
}
